public class ConfigVerifyCtl {
    
    public Boolean ConfiguredOk { 
        get{ return (ConfiguredOk = ((ESRows==1) && (StopStatuses>0))); }
        private set; 
    }

    public Integer ESRows { 
        get{ return (ESRows = [Select Count() From Entitlements_Settings__c]); }
        private set; 
    }

    public String DefEntHintMismatches { 
        get {
        	String s = '';
			for(Support_Program__c sp:[Select Name,DefEntHint__c,
				(Select Id From Entitlements__r Where IsDefault__c=True And EntState__c='Active') 
				From Support_Program__c]) {
				if ((sp.Entitlements__r.size() != 0)&&(sp.Entitlements__r[0].Id != sp.DefEntHint__c)) {
					s += '\n            ' + sp.Entitlements__r[0].Id;
				}
			}
        	return (DefEntHintMismatches = s); 
        }
        private set; 
    }
    
    public Integer StopStatuses { 
        get{ return (StopStatuses = [Select Count() From Stop_Status__c]); }
        private set; 
    }
        
    public Boolean ThrowEqOne {
        get { return (ThrowEqOne=(ApexPages.currentPage().getParameters().get('throw')=='1')); }
        private set;
    }
    
    static testMethod void testConfigVerifyCtl() {
        ConfigVerifyCtl c = new ConfigVerifyCtl();
        String s = c.DefEntHintMismatches;
        system.assertEquals(c.ConfiguredOk,((c.ESRows==1)&&(c.StopStatuses>0)));
        
        system.assertNotEquals(true,c.ThrowEqOne,'Should only be true when throw=1');
        ApexPages.currentPage().getParameters().put('throw','1');
        system.assertEquals(true,c.ThrowEqOne,'Should be true since throw=1 was set');        
        
    }
   
}